package com.emcom.gotour.mvc.view;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.emcom.gotour.enums.TourType;
import com.emcom.gotour.vo.TourTypeVO;

public class TourView implements Comparable<Object>, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 9122530957437913136L;
	private String title;
	private List<TourTypeVO> tourTypeList;
	private List<String> categoryList;
	private List<?> tourList;
	private NavigationView navigationView;
	private GlobalView globalView;
	private TourContentView tourContentView;
	public List<TourTypeVO> getTourTypeList() {
		TourType[] tourTypes = TourType.values();
		List<TourTypeVO> tourTypeVOList = new ArrayList<TourTypeVO>();
		for(TourType tourType : tourTypes) {
			TourTypeVO tourTypeVO = new TourTypeVO();
			tourTypeVO.setId(tourType.name());
			tourTypeVO.setName(tourType.value());
			tourTypeVOList.add(tourTypeVO);
		}
		return tourTypeVOList;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public void setTourTypeList(List<TourTypeVO> tourTypeList) {
		this.tourTypeList = tourTypeList;
	}
	public List<String> getCategoryList() {
		return categoryList;
	}
	public void setCategoryList(List<String> categoryList) {
		this.categoryList = categoryList;
	}
	public List<?> getTourList() {
		return tourList;
	}
	public void setTourList(List<?> tourList) {
		this.tourList = tourList;
	}
	public NavigationView getNavigationView() {
		return navigationView;
	}
	public void setNavigationView(NavigationView navigationView) {
		this.navigationView = navigationView;
	}
	public GlobalView getGlobalView() {
		return globalView;
	}
	public void setGlobalView(GlobalView globalView) {
		this.globalView = globalView;
	}
	public TourContentView getTourContentView() {
		return tourContentView;
	}
	public void setTourContentView(TourContentView tourContentView) {
		this.tourContentView = tourContentView;
	}
	/**
	 * @see java.lang.Comparable#compareTo(Object)
	 */
	public int compareTo(Object object) {
		TourView myClass = (TourView) object;
		return new CompareToBuilder().append(this.tourContentView,
				myClass.tourContentView).append(this.title, myClass.title)
				.append(this.tourList, myClass.tourList).append(
						this.categoryList, myClass.categoryList).append(
						this.globalView, myClass.globalView).append(
						this.tourTypeList, myClass.tourTypeList).append(
						this.navigationView, myClass.navigationView)
				.toComparison();
	}
	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof TourView)) {
			return false;
		}
		TourView rhs = (TourView) object;
		return new EqualsBuilder().appendSuper(super.equals(object)).append(
				this.tourContentView, rhs.tourContentView).append(this.title,
				rhs.title).append(this.tourList, rhs.tourList).append(
				this.categoryList, rhs.categoryList).append(this.globalView,
				rhs.globalView).append(this.tourTypeList, rhs.tourTypeList)
				.append(this.navigationView, rhs.navigationView).isEquals();
	}
	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-949141585, -265577091).appendSuper(
				super.hashCode()).append(this.tourContentView).append(
				this.title).append(this.tourList).append(this.categoryList)
				.append(this.globalView).append(this.tourTypeList).append(
						this.navigationView).toHashCode();
	}
	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this).append("tourContentView",
				this.tourContentView).append("globalView", this.globalView)
				.append("tourTypeList", this.tourTypeList).append(
						"navigationView", this.navigationView).append(
						"tourList", this.tourList).append("title", this.title)
				.append("categoryList", this.categoryList).toString();
	}
}
